package com.housekeeping.housekeeping.administrator.adminsinformation.service.qeury;

import com.housekeeping.housekeeping.administrator.adminsinformation.dao.QeuryDao;
import com.housekeeping.housekeeping.administrator.adminsinformation.dao.impl.QeuryDaoImpl;
import com.housekeeping.housekeeping.administrator.entity.AdminsClassify;
import com.housekeeping.housekeeping.administrator.entity.AdminsInformation;
import com.housekeeping.housekeeping.administrator.utils.Page;

import java.sql.SQLException;
import java.util.List;

public class QeuryServiceImpl implements QeuryService{
    private QeuryDao qeuryDao=new QeuryDaoImpl();
    @Override
    public Page<AdminsInformation> list(int page, int size,String station,String name) throws SQLException {
        List<AdminsInformation> list = qeuryDao.qeury((page - 1) * size, size,station,name);
        int count = qeuryDao.selectCount(station,name,(page - 1) * size,size);
        Page<AdminsInformation> pageBean = new Page<>(page, size, count);
        pageBean.setData(list);
        return pageBean;
    }
}
